package com.example.demo.exception;

import com.example.demo.constant.ResponseCode;
import lombok.Data;

/**
 *@Description 参数校验异常
 *@Author Levi
 *@Date 2019/4/24-12:32
*/
@Data
public class ParamsCheckException extends Exception {

    private static final long serialVersionUID = -3448595563459658126L;


    /**
     * 异常编码
     */
    private int code;

    /**
     * 异常信息
     */
    private String message;

    public ParamsCheckException(){
        super();
    }

    public ParamsCheckException(int code, String message){
        this.code = code;
        this.message = message;
    }

    public ParamsCheckException(String message){
        this.message = message;
    }

    public ParamsCheckException(ResponseCode responseCode){
        this.code = responseCode.getCode();
        this.message = responseCode.getMsg();
    }

}
